#ifndef _SHOW_DIR_DEMO_H_
#define _SHOW_DIR_DEMO_H_

#include "../lvgl/lvgl.h"
#include "../lvgl/demos/lv_demos.h"
#include "../lv_drivers/display/fbdev.h"
#include "../lv_drivers/indev/evdev.h"
#include <unistd.h>
#include <pthread.h>
#include <time.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>
#include <sys/types.h>
#include <dirent.h>
#include <libgen.h>


#define SEARCH_PATH "/"

typedef struct view_obj
{
    lv_obj_t * main_window;
    lv_obj_t * dir_list;
    lv_obj_t * file_window;
} view_obj, *P_view_obj;

struct btn_file_info
{
    char new_path[256];
    P_view_obj inf_heap;
};

P_view_obj main_view();

bool show_file_list(char * path, P_view_obj show_win);

void dir_btn_pres(lv_event_t * e);
bool show_file_list(char * path, P_view_obj show_win);
bool show_file(P_view_obj inf_heap,char * btn_text,int abs_x,int abs_y,char * base_path);
void file_btn_click(lv_event_t * e);
void exit_event_cb(lv_event_t * e);


#endif